<template>
    <div class="page-tool">
        <div class="item close" title="移除" @click="removeItem">&times;</div>
        <div class="item num">{{ num }}</div>
    </div>
</template>

<script>
export default {
    props: {
        num: {
            type: Number,
            default: 1
        },
        item: {
            type: Array,
            default: function () {
                return []
            }
        }
    },
    data() {
        return {}
    },
    methods: {
        removeItem() {
            console.log('remove', this.item, this.num)
            this.$emit('removeItem', { list: this.item, index: this.num })
        }
    }
}
</script>

<style scoped lang="less">
.page-tool {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    .item {
        width: 20px;
        height: 20px;
        margin-right: 5px;
        border-radius: 50%;
        font-size: 12px;
        text-align: center;
        line-height: 20px;
        font-weight: bold;
    }
    .close {
        color: #222222;
        background: rgba(208, 208, 208, 0.5);
        cursor: pointer;
    }
    .num {
        background: rgba(0, 170, 255, 1);
        color: #fff;
    }
}
</style>
